home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2003 November A / PCWK1103A.iso / ABBYY FineReader 7.0 PRO / data1.cab / gs_trap.ps < prev    next >
Text File  |  2002-04-03  |  3KB  |  104 lines

  1. %    Copyright (C) 1999, 2000 Aladdin Enterprises.  All rights reserved.
  2. % This software is provided AS-IS with no warranty, either express or
  3. % implied.
  4. % This software is distributed under license and may not be copied,
  5. % modified or distributed except as expressly authorized under the terms
  6. % of the license contained in the file LICENSE in this distribution.
  7. % For more information about licensing, please refer to
  8. % http://www.ghostscript.com/licensing/. For information on
  9. % commercial licensing, go to http://www.artifex.com/licensing/ or
  10. % contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  11. % San Rafael, CA  94903, U.S.A., +1(415)492-9861.
  12.  
  13. % $Id: gs_trap.ps,v 1.3.6.2 2002/04/02 13:57:27 mpsuzuki Exp $
  14. % PostScript LanguageLevel 3 in-RIP trapping support.
  15.  
  16. ll3dict begin
  17.  
  18. % We need LanguageLevel 2 or higher in order to have setuserparams and
  19. % defineresource.
  20. languagelevel dup 2 .max .setlanguagelevel
  21.  
  22. % ------ Trapping ------ %
  23.  
  24. % The PostScript-level trapping parameters are maintained in userdict,
  25. % and explicitly reinstalled upon restore.
  26.  
  27. /Trapping mark
  28.  
  29. /settrapparams dup {        % <paramdict> settrapparams -
  30.   /.trapparams .uservar dup length dict .copydict
  31.   dup 2 index {
  32.             % Stack: paramdict olddict olddict key value
  33.     2 index 2 index known { put dup } { pop pop } ifelse
  34.   } forall pop
  35.   dup .settrapparams    % Let the operator check parameter validity.
  36.   .userdict /.trapparams 3 -1 roll put pop
  37. } bind .makeoperator
  38.  
  39. /.copyparams {        % <obj> .copyparams <obj'>
  40.   dup type /dicttype eq {
  41.     dup length dict .copydict
  42.     dup {
  43.       .copyparams 3 copy put pop pop
  44.     } forall
  45.   } {
  46.     dup type /arraytype eq {
  47.       [ exch { .copyparams } forall ]
  48.     } if
  49.   } ifelse
  50. } odef
  51.  
  52. /currenttrapparams dup {    % - currenttrapparams <paramdict>
  53.   /.trapparams .uservar .copyparams
  54. } bind .makeoperator
  55.  
  56. /settrapzone dup {        % - settrapzone -
  57.     % ****** DUMMY ******
  58.   newpath
  59. } bind .makeoperator
  60.  
  61. % Define initial (dummy) trapping parameters.
  62. % These values are mostly complete guesses.
  63. userdict /.trapparams mark
  64.   /BlackColorLimit 1.0
  65.   /BlackDensityLimit 1.0
  66.   /BlackWidth 1.0
  67.   /ColorantZoneDetails 0 dict
  68.   /Enabled true
  69.   /HalftoneName null
  70.   /ImageInternalTrapping false
  71.   /ImagemaskTrapping true
  72.   /ImageResolution 1
  73.   /ImageToObjectTrapping true
  74.   /ImageTrapPlacement /Center
  75.   /SlidingTrapLimit 1.0
  76.   /StepLimit 1.0
  77.   /TrapColorScaling 0.0
  78.   /TrapSetName null
  79.   /TrapWidth 1.0
  80. .dicttomark readonly put
  81.  
  82. .dicttomark /ProcSet defineresource pop
  83.  
  84. % Define the InkParams and TrapParams resource categories.
  85. { /InkParams /TrapParams } {
  86.   /Generic /Category findresource dup maxlength 3 add dict .copydict begin
  87.     /InstanceType /dicttype def
  88.   currentdict end /Category defineresource pop
  89. } forall
  90.  
  91. % Define the TrappingType resource category.
  92. /Generic /Category findresource dup maxlength 3 add dict .copydict begin
  93.   /InstanceType /integertype def
  94. /TrappingType currentdict end /Category defineresource pop
  95.  
  96. {1001} { dup /TrappingType defineresource pop } forall
  97.  
  98. .setlanguagelevel
  99.  
  100. end            % ll3dict
  101.